
export async function run(characters, items_key, index) {
    let item = characters[items_key][index];
    // 品质
    let level = item["品质"] || 1;
    if (G.ItemUtils.add_hp_items_data[item["名称"]]) {
        //加血
        G.Characters.remove_item(characters["id"], items_key, index, 1);
        let hp = G.ItemUtils.add_hp_items_data[item["名称"]](level);
        characters["气血"] += hp;
        if (characters["气血"] > characters["最大气血"]) {
            characters["气血"] = characters["最大气血"];
        }
        ClientUtils.send_characters_client_message(characters["id"], 36, { "动画": "加血" });
        G.Characters.refrush_hp_data(characters["id"]);
        G.MapUtils.send_play(characters["id"],"加血");
    }
    if (G.ItemUtils.add_mp_items[item["名称"]]) {
        //加蓝
        G.Characters.remove_item(characters["id"], items_key, index, 1);
        let mp = G.ItemUtils.add_mp_items[item["名称"]](level);
        characters["魔法"] += mp;
        if (characters["魔法"] > characters["最大魔法"]) {
            characters["魔法"] = characters["最大魔法"];
        }
        ClientUtils.send_characters_client_message(characters["id"], 36, { "动画": "加蓝" });
        G.Characters.refrush_hp_data(characters["id"]);
        G.MapUtils.send_play(characters["id"],"加蓝");
    }
    if(G.ItemUtils.add_hp_mp_data[item["名称"]]){
        //加血蓝
        G.Characters.remove_item(characters["id"], items_key, index, 1);
        let data = G.ItemUtils.add_hp_mp_data[item["名称"]](level);
        characters["气血"] += data[0];
        if (characters["气血"] > characters["最大气血"]) {
            characters["气血"] = characters["最大气血"];
        }
        characters["魔法"] += data[1];
        if (characters["魔法"] > characters["最大魔法"]) {
            characters["魔法"] = characters["最大魔法"];
        }
        ClientUtils.send_characters_client_message(characters["id"], 36, { "动画": "加血" });
        ClientUtils.send_characters_client_message(characters["id"], 36, { "动画": "加蓝" });
        G.MapUtils.send_play(characters["id"],"加血");
        G.MapUtils.send_play(characters["id"],"加蓝");
    }
}